package xyz.xuminghai.javafx_learn.stage;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.stage.Popup;
import javafx.stage.Stage;

/**
 * 2023/1/9 14:09 星期一<br/>
 * <p>
 * 弹出窗口
 *
 * @author xuMingHai
 */
public class PopupApp extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        Button button = new Button("弹出窗口");
        Popup popup = new Popup();
        popup.getContent().add(new Label("Popup"));
        button.setOnAction(event -> popup.show(primaryStage));

        primaryStage.setScene(new Scene(button));
        primaryStage.setTitle("PopupApp");
        primaryStage.show();

    }
}
